//
//  EFOrderStatusCell.m
//  EnjogFood
//
//  Created by 王芳 on 17/5/11.
//  Copyright © 2017年 wf. All rights reserved.
//

#import "EFOrderStatusCell.h"
#import "EFOrderStatusItem.h"

@interface EFOrderStatusCell ()
@property (strong, nonatomic) UILabel *payStatusLabel;
@property (strong, nonatomic) UIImageView *backgroundImageV;

@end
@implementation EFOrderStatusCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self initUI];
    }
    return self;
}

- (void)initUI{
    [self.contentView addSubview:self.backgroundImageV];
    [self.contentView addSubview:self.payStatusLabel];
}

- (void)setObject:(EFOrderStatusItem *)item{
    self.payStatusLabel.text = item.orderStatus;
    [self.payStatusLabel sizeToFit];
    self.payStatusLabel.left = 20;
    self.payStatusLabel.top = (self.height - self.payStatusLabel.height)/2 + 5;
}

- (UILabel *)payStatusLabel{
    if (!_payStatusLabel) {
        _payStatusLabel = [[UILabel alloc] init];
        _payStatusLabel.textColor = [UIColor whiteColor];
        _payStatusLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _payStatusLabel;
}

- (UIImageView *)backgroundImageV{
    if (!_backgroundImageV) {
        _backgroundImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 50)];
        _backgroundImageV.image = IMG(@"statusbar_bg_image_orderdeatail");
    }
    return _backgroundImageV;
}

@end
